# L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack']

# print(L[1:3])

# print(L[-2:])

# L = list(range(100))

# print(L)

# print(L[:10])

# print(L[-10:])

# print(L[10:20])

# print(L[:10:2])

# print(L[::5])

# T = tuple(range(100))
# print(T[:10])


# print('ABCDEFG'[:3])

# print('ABCDEFG'[::2])

def trim(s):
    if s is None or len(s) == 0:
        pass

    while s[0] == ' ':
        s = s[1:]
    while s[-1] == ' ':
        s = s[:-1]
    return s

print(trim('   Hello   World    '))